//
//  NineCollectionViewCell.m
//  DaHaiDouBan
//
//  Created by dllo on 15/11/4.
//  Copyright © 2015年 Wang Dahai. All rights reserved.
//

#import "NineCollectionViewCell.h"
#import "UIImageView+WebCache.h"
@implementation NineCollectionViewCell
- (void)dealloc
{
    [_movieNameLabel release];
    [_pic_urlImageView release];
    [_movie release];
    [super dealloc];
}
-(instancetype)initWithFrame:(CGRect)frame
{
    
    self = [super initWithFrame:frame];
    if (self) {
        
        [self createSubviews];
    }
    return self;
    
    
}
-(void)createSubviews
{
    self.pic_urlImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 100, 150)];
    [self.contentView addSubview:self.pic_urlImageView];
    [_pic_urlImageView release];
    
    self.movieNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 150, 100, 20)];
    [self.contentView addSubview:self.movieNameLabel];
    [_movieNameLabel release];
    //self.movieNameLabel.backgroundColor = [UIColor purpleColor];      
}

-(void)setMovie:(Movie *)movie
{
    
    if (_movie != movie) {
        
        [_movie release];
        
        _movie = [movie retain];
    }
    
    self.movieNameLabel.text = _movie.movieName;
    [self.pic_urlImageView sd_setImageWithURL:[NSURL URLWithString:_movie.pic_url] placeholderImage:[UIImage imageNamed:@"picholder@2x"]];
 
}

@end
